<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
        <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
        <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<div class="content">
	  <div class="main-content">
<ul class="nav nav-tabs">
  <li class="active"><a href="#home" data-toggle="tab">Profile</a></li>
  <li><a href="#profile" data-toggle="tab">Upload</a></li>
</ul>

<div class="row">
  <div class="col-md-8">
    <br>
    <div id="myTabContent" class="tab-content">
      <div class="tab-pane active in" id="home">
     <c:if test="${not empty message}">
    	<div id="message" class="alert alert-success"><button data-dismiss="alert" class="close">×</button>${message}</div>
	</c:if>
     
      <form:form id="userForm" action=" ${pageContext.request.contextPath}/ti/add" modelAttribute="tiVO" method="post">
        <div class="form-group">
        <label><spring:message code="ti.examSubjectId"/></label>
        <%-- <form:input path="examSubjectId" cssClass="form-control required" /><form:errors path="examSubjectId"/> --%>
        <form:select path="examSubjectId"  cssClass="form-control required" items="${subject }"></form:select>
        </div>
         <div class="form-group">
        <label><spring:message code="ti.tiId"/></label>
        	<form:input path="examTiId" cssClass="form-control required" /><form:errors path="examTiId"/>
        </div>
        
        <div class="form-group">
        <label><spring:message code="ti.tiName"/></label>
        <form:textarea path="examTiName" cssClass="form-control {required:true}"/><form:errors path="examTiName"/>
        </div>
        
         <div class="form-group">
        <label><spring:message code="ti.optionA"/></label>
        <form:input path="examTiOptiona" cssClass="form-control required" /><form:errors path="examTiOptiona"/>
        </div>
      
		 <div class="form-group">
        <label><spring:message code="ti.optionB"/></label>
        <form:input path="examTiOptionb" cssClass="form-control required" /><form:errors path="examTiOptionb"/>
        </div>
        
         <div class="form-group">
        <label><spring:message code="ti.optionC"/></label>
        <form:input path="examTiOptionc" cssClass="form-control required" /><form:errors path="examTiOptionc"/>
        </div>
        
         <div class="form-group">
        <label><spring:message code="ti.optionD"/></label>
        <form:input path="examTiOptiond" cssClass="form-control required" /><form:errors path="examTiOptiond"/>
        </div>
        
         <div class="form-group">
        <label><spring:message code="ti.key"/></label>
        <form:input path="examTiKey" cssClass="form-control {required:true}" /><form:errors path="examTiKey"/>
        </div>
        
         <div class="form-group">
        <label><spring:message code="ti.point"/></label>
        <form:input path="examTiPoint" cssClass="form-control required" /><form:errors path="examTiPoint"/>
        </div>
        
         <div class="form-group">
        <label><spring:message code="ti.difficulty"/></label>
        <%-- <form:input path="examTiDifficulty" cssClass="form-control required" /><form:errors path="examTiDifficulty"/> --%>
        <form:select path="examTiDifficulty" items="${tiDiff}" cssClass="form-control required"/>
        </div>
        
         <div class="form-group">
        <label><spring:message code="ti.tiType"/></label>
        <%-- <form:input path="examTiId" cssClass="form-control required" /><form:errors path="examTiId"/> --%>
        <form:select path="examTiType" cssClass="form-control required" items="${tiType }" ></form:select>
        </div>

       <div class="btn-toolbar list-toolbar">
      		<button class="btn btn-primary"><i class="fa fa-save"></i> Save</button>
     	 	<a href="#myModal" data-toggle="modal" class="btn btn-danger">Delete</a>
   	 	</div>
        </form:form>
      </div>
      
      

 <%--      <div class="tab-pane fade" id="profile">

		 <c:if test="${not empty message}">
				    <div id="message" class="alert alert-success"><button data-dismiss="alert" class="close">×</button>${message}</div>
				</c:if>
				<form:form id="upload" method="post" action="${pageContext.request.contextPath}/upload" enctype="multipart/form-data">
			        <div class="form-group">
					    <label for="exampleInputFile" class="control-label">选择上传文件</label>
					    <input type="file" id="exampleInputFile" name="file" class="form-control">
					  </div>
			        
			 		<div>
			              <button class="btn btn-primary" type="submit">Upload</button>
			             <button class="btn btn-default" onclick="history.go(-1)">Cancel</button>
			          </div>
			          </form:form>
      </div> --%>
    </div>

   
  </div>
</div>

<script>
	$().ready(function(){
		$("#userForm").validate({
			errorPlacement: function(error, element) {  
			    error.appendTo(element.prev()); 
			}
		});
	})
</script>
</body>
</html>